import { getToken } from '@/utils'
import { Navigate } from 'react-router-dom'

function Auth({ children }) {
    if (getToken()) {
        return (
            <>{children}</>
        )
    } else {
        return (
            <Navigate to="/login" replace></Navigate>
        )
    }
}

export {
    Auth
}